<%--
  Created by IntelliJ IDEA.
  User: Admin
  Date: 2016/8/21
  Time: 10:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <title>Title</title>
    <style>
        .error{ color: red}
    </style>
    <style type="text/css">
        p{color: red}
    </style>
</head>
<body>
<div align="center">
    <h2>请填写登录信息</h2><br><br>
<c:if test="${!empty requestScope.login}">
   <p> ${requestScope.login}</p>
</c:if>
    <form action="/user/login" method="post" id="loginForm">
        用户名:<input type="text" name="username"/><br><br>
        密码:&nbsp;<input type="password" name="password"/><br><br>
       <input type="submit" value="登录"/>&nbsp;&nbsp;
        <a href="newuser.jsp">注册</a>
    </form>

    <script src="http://static.runoob.com/assets/jquery-validation-1.14.0/lib/jquery.js"></script>
    <script src="http://static.runoob.com/assets/jquery-validation-1.14.0/dist/jquery.validate.min.js"></script>
    <script>
        $("#loginForm").validate({
            rules: {
                username: {
                    required: true
                },
                password: {
                    required: true,
                    minlength: 3
                }
            },
            messages:{
                username:{
                    required: "请输入用户名"
                },

                password: {
                    required: "请输入密码",
                    minlength: "密码长度不能小于 3 个字母"
                }
            }
        });

    </script>
</div>
</body>
</html>
